home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / util / tgrep20.zip / GETPAGES.H < prev    next >
C/C++ Source or Header  |  1994-03-29  |  783b  |  43 lines

  1. #ifdef BSD
  2. #ifndef BSD4_1
  3. #define HAVE_GETPAGESIZE
  4. #endif
  5. #endif
  6.  
  7. #ifndef HAVE_GETPAGESIZE
  8.  
  9. #ifdef VMS
  10. #define getpagesize() 512
  11. #endif
  12.  
  13. #ifdef HAVE_UNISTD_H
  14. #include <unistd.h>
  15. #endif
  16.  
  17. #ifdef _SC_PAGESIZE
  18. #define getpagesize() sysconf(_SC_PAGESIZE)
  19. #else
  20.  
  21. #ifdef HAVE_SYS_PARAM_H
  22. #include <sys/param.h>
  23.  
  24. #ifdef EXEC_PAGESIZE
  25. #define getpagesize() EXEC_PAGESIZE
  26. #else
  27. #ifdef NBPG
  28. #define getpagesize() NBPG * CLSIZE
  29. #ifndef CLSIZE
  30. #define CLSIZE 1
  31. #endif /* no CLSIZE */
  32. #else /* no NBPG */
  33. #define getpagesize() NBPC
  34. #endif /* no NBPG */
  35. #endif /* no EXEC_PAGESIZE */
  36. #else /* !HAVE_SYS_PARAM_H */
  37. #define getpagesize() 8192    /* punt totally */
  38. #endif /* !HAVE_SYS_PARAM_H */
  39. #endif /* no _SC_PAGESIZE */
  40.  
  41. #endif /* not HAVE_GETPAGESIZE */
  42.  
  43.